package net.huashitong.synthetical.showView.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.synthetical.showView.dao.ProjectProgressDao;
import net.huashitong.synthetical.showView.entity.ProjectProgress;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ProjectProgressService extends StringPKService<ProjectProgress> {

    @Autowired
    private ProjectProgressDao dao;

    @Autowired
    private SysTableService tableService;

    @Override
    protected BaseDao<ProjectProgress, String> getDao() {
        return dao;
    }

    @Override
    protected void beforeSave(ProjectProgress projectProgress) {
        projectProgress.setSysId(tableService.updateMaxSysId("t_syn_project_progress", null));
    }
}
